/**
 * Abstract class for all attributes
 * The methods implement the CGInterface.
 * @author MLB
 *
 */
public class GenericAttribute extends Operand3a{
    public Type type;

    public GenericAttribute(Type t){
	type = t;
    }
    
    public String toString(){
	if(type != null) return type.toString();
	else return "";
    }
    
    public boolean isText(){
	return TypeSystem.T_c_text == type;
    }
    
    public String getName3a(){
	return "";
    }
	
    public int getScope(){
	return -1;
    }
    
    public int getSize(){
	return type.getSize();
    }
    
    public boolean isArray(){
	return type.typeExpression().getName().equals( "ARRAY");
    }
    
    public boolean isConstInteger(){
	return (type == TypeSystem.T_c_integer);
    }
    
    public boolean isLabel(){
	return (type == TypeSystem.T_label);
    }
    
    public boolean isPointer(){
	return (type == TypeSystem.T_pointer);
    }
    
    public boolean isVarInteger(){
	return (type == TypeSystem.T_integer);
    }
    
    public boolean isParam(){
    	return false;
    }
}
